
public class DLLNode<T> {

		//instance variables
	private DLLNode<T> next;
	private DLLNode<T> prev;
	private T nodeData;

	
	//default constructor
	public DLLNode(){
		next=null;
		prev=null;
		nodeData=null;
	}
	//overloaded constructor
	public DLLNode(T value, DLLNode<T> successor){
		nodeData=value;
		next=successor;
	}
	
	//accessors
	public DLLNode<T> getNext(){
		return next;
	}
	public DLLNode<T> getPrev(){
		return prev;
	}
	public T getNodeData(){
		return nodeData;
	}
	//mutators
	public void setNext(DLLNode<T> newNext){
		next=newNext;
	}
	public void setPrev(DLLNode<T> newPrev){
		prev=newPrev;
	}
	public void setNodeData(T what){
		nodeData=what;
	}
	
		//General Methods
	
	//converts a particular node to a String, called in DLL Class
	public String toString(int counter){
		
		String a="";			//String to be returned
		
				//if node is head
			if(this.getPrev()==null){
			
				a+="\n"+counter+":Dummy Node";
			}
				//if node is tail
			else if(this.getNext()==null){
				a+="\n"+counter+":Dummy Node";
			}
				//if node is anything besides head or tail
			else{
				a+="\n"+counter+":"+nodeData.toString();
			}
			
					
				
			
		
		
		return a;
	}
	
}
